package cn.gs.common.controller;

import cn.gs.system.entity.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

/**
 * @author gs
 * @date 2020/1/10
 */
public class BaseController {

    public static Subject getSubject(){
        return SecurityUtils.getSubject();
    }

    public  Session getSession(){
        return getSubject().getSession();
    }

    public User getCurrentUser(){
        return (User)getSubject().getPrincipal();
    }
}
